const express = require("express");
const multer = require("multer");
// const cors = require("./modules/cors");
// const isLogin = require("./modules/isLogin");
// const login = require("./routers/login")
// const getUserRoute = require("./routers/user/get")
// const setUserRoute = require("./routers/user/set")
// const setTeamRoute = require("./routers/team/set")
// const xxxRoute = require("./routers/xxx/xxx");
const uploadRoute = require("./routers/upload");

const app = express();
const upload = multer({dest:"./upload"});

// 注册中间件
app.use( express.static("./www") )
app.use( express.static("./upload") )
app.use( express.urlencoded() )
app.use( upload.any() )

// 配置跨域
// app.all( "*", cors );

// app.get("/login", login);

// 配置验证登录状态
// app.all( "*", isLogin );

// 功能路由
app.post("/upload", uploadRoute);
// app.post("/getuser", getUserRoute);
// app.post("/setuser", setUserRoute);

// app.post("/setteam", setTeamRoute);

// app.post("/xxx", xxxRoute);

app.listen(3000, ()=>{
  console.log("开启成功")
})